package com.krediti.session;

import java.util.ArrayList;
import java.util.List;

import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

import com.krediti.entity.KreditniZahtev;
import com.krediti.entity.Namena;

@Name("namenaHome")
public class NamenaHome extends EntityHome<Namena> {

	/**
	 * Generated serial version.
	 */
	private static final long serialVersionUID = 815923317878129476L;

	public void setNamenaId(Integer id) {
		setId(id);
	}

	public Integer getNamenaId() {
		return (Integer) getId();
	}

	@Override
	protected Namena createInstance() {
		Namena namena = new Namena();
		return namena;
	}

	public void wire() {
		getInstance();
	}

	public boolean isWired() {
		return true;
	}

	public Namena getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

	public List<KreditniZahtev> getKreditniZahtev() {
		return getInstance() == null ? null : new ArrayList<KreditniZahtev>(
				getInstance().getKreditniZahtev());
	}

}
